/*------------------------------------------------------------------------------
*** PURPOSE: 	The following do-file generates Table 6 in the paper "Respondent 
				biases in household surveys" by Andrew Dillon and Edouard Romeo 
				Mensah. 

*** NOTE:		Relevant globals are defined in the do-file titles "master.do"
				contained in the folder "02_do" in the replication package.
------------------------------------------------------------------------------*/

		
		* Table 6. Gender effects on agricultural outcomes among random proxy
		* responding households.
		
		
			preserve
		
			keep if treatarm==2
		
			eststo clear
			foreach i in $depvars6 {
				reg `i' i.resp_female, vce(cluster village)
				qui sum `i' if e(sample) & resp_female==0
				local malemean=r(mean)
				local malesd=r(sd)
				testparm i.resp_female
				local pvalue_all=r(p)
				eststo `i'_A, addscalars(pvalue_all `pvalue_all' ///
				Malemean `malemean' Malesd `malesd')
			}
			
	
		
			esttab *_A using "04_output\Table 6. Gender effects on agricultural outcomes among random proxy responding households.csv", se ///
			scalars("pvalue_all p-value" N "Malemean Male Means" "Malesd Male S.D.") sfmt(3 0 3 3) ///
			title("Table 6: Gender effects on agricultural outcomes among random proxy responding households") ///
			mtitles("Edge land area (ha)" "Total landholdings (ha)" "Total area cultivated (ha)" "Main mode of aquiring cultivated plots: inheritance" "Main mode of aquiring cultivated plots: gift/donation" "Main mode of aquiring cultivated plots: other" "HH used fertilizer" "Log quantity of fertilizer (kg/ha)" "Log value of fertilizer (USD/ha)" "HH used salaried labor" "Rice" "Sorghum" "Cereals" "Bean" "Sesame" "Legumes" "Okra" "Vegetables" "Cash crops" "Cash diversity score" "Log value of cereal output (USD)" "Log value of legume output (USD)" "Log value of vegetable output (USD)" "Log value of food crop output (USD)" "Log value of cash crop output (USD)" "Log total value of output (USD)") ///
			nonotes addnotes("All standard errors are clustered at the village level. *** p<0.01; ** p<0.05; * p<0.1." "Estimated without unbalanced covariates.") star(* 0.1 ** 0.05 *** 0.01) ///
			coeflabels(1.resp_female "Female proxy respondent") drop(0.resp_female _cons) ///
			b(3) se(3) noobs width(25) replace
			
			estimates clear	
		
			restore	

			
			